package projects.android.sms.object;

import java.sql.Date;

/**
 * Simple object representing a text message.
 * 
 * @author Thomas Jaeger
 * @author Mario Kraml
 * @author Tassilo Posegga
 * @author Robert Schenkenfelder
 * 
 */
public class SMS {

	private Date date;
	private String message;
	private String phonenumber;
	private int id;
	private boolean incoming;

	public SMS() {
		// empty default constructor
	}

	/**
	 * Constructs a new SMS with the given body, phone number, date and a flag indicating whether this was a incoming or
	 * outgoing message.
	 * 
	 * @param body
	 *            Message body.
	 * @param phoneNumber
	 *            Phone number of the conversation partner this text message is associated to.
	 * @param date
	 *            Date of arrival/departure.
	 * @param incoming
	 *            True if this message is a incoming one, false if this message is a outgoing one.
	 */
	public SMS(String body, String phoneNumber, long date, boolean incoming) {
		this.date = new Date(date);
		this.message = body;
		this.phonenumber = phoneNumber;
		this.incoming = incoming;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(long dateLong) {
		Date date = new Date(dateLong);
		this.date = date;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getPhonenumber() {
		return phonenumber;
	}

	public void setPhonenumber(String username) {
		this.phonenumber = username;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public boolean isIncoming() {
		return this.incoming;
	}

	public void setIncoming(boolean incoming) {
		this.incoming = incoming;
	}
}
